<?php
/**
 * 描述：资讯-主页。
 */
final class Exec_News_Index extends Exec
{
    public function Get()
    {
        #获取数据-头条
        $data=DB::GetRows('select * from news where M_IsHeadline=TRUE and M_IsDelete=FALSE order by M_IsHeadline_Datetime desc,ID desc limit 0,1');
        if($data)
        {
            $data[0]['Content']=strip_tags($data[0]['Content']);
            $data[0]['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$data[0]['Thumbnail'];
            $data[0]['M_HTMLFile']=Config::PATH_RELATIVE_CONTENT_NEWS.'/'.$data[0]['M_HTMLFile'];
        }
        View::Assign('News_Index_Headline',@$data[0]);

        #获取数据-推荐
        $data=DB::GetRows('select * from news where M_IsRecommend=TRUE and M_IsDelete=FALSE order by M_IsRecommend_Datetime desc limit 0,4');
        if($data)
        {
            foreach ($data as &$row)
            {
                $row['ClassName']=DAO_NewsClass::GetNameByID($row['ClassID']);
                $row['M_HTMLFile']=Config::PATH_RELATIVE_CONTENT_NEWS.'/'.$row['M_HTMLFile'];
            }
        }
        View::Assign('News_Index_Recommend',$data);

        #获取数据-排行
        View::Assign('News_Index_Ranking',DAO_News::Ranking());
        
        #获取数据-访谈
        $data=DB::GetRows('select * from interview order by ID desc limit 0,3');
        @$data[0]['ThumbnailPath']=Config::PATH_RELATIVE_ATTACHMENT_TEMP.'/'.@$data[0]['ThumbnailPath'];
        View::Assign('News_Index_Interview_Topside',@$data[0]);
        View::Assign('News_Index_Interview',array_slice($data,1,count($data)));

        #获取数据-专题
        $data=DB::GetRows('select * from topic order by ID desc limit 0,3');
        foreach($data as &$row)
        {
            $row['ThumbnailPath']=Config::PATH_RELATIVE_ATTACHMENT_TOPIC.'/'.$row['ThumbnailPath'];
        }
        View::Assign('News_Index_Topic',$data);

        #获取数据-观察
        $data=DB::GetRows('select * from news where M_IsDelete=FALSE and SubclassID='.DAO_NewsClass::OBSERVE_COMMENT_ID.' and Thumbnail is not NULL and Thumbnail<>"" order by M_IsTop desc,M_IsTop_Datetime desc,ID desc limit 0,4');
        foreach($data as &$row)
        {
            $row['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$row['Thumbnail'];
        }
        View::Assign('NewsClass_ObserveComment_ID',DAO_NewsClass::OBSERVE_COMMENT_ID);
        View::Assign('News_Index_Observe',$data);
        
        #获取数据-船舶行情
		$areaCount=8;
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::SHIPYARD_CONJUNCTURE_ID.' and M_IsDelete=FALSE and M_IsTop=TRUE order by M_IsTop desc,M_IsTop_Datetime desc,ID desc limit 0,1');
        if($data)
        {
            $data=$data[0];
            $data['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$data['Thumbnail'];
            $data['Content']=strip_tags($data['Content']);
			$areaCount=3;
        }
        View::Assign('News_Index_ShipyardfConjuncureTopside',$data);

        $data=DB::GetRows('select * from news where '.($data==NULL ? '1=1':'ID<>'.$data['ID']).' and SubclassID='.DAO_NewsClass::SHIPYARD_CONJUNCTURE_ID.' and M_IsDelete=FALSE order by ID desc limit 0,'.$areaCount);
        if($data)
        {
            foreach($data as &$row)
            {
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_Conjuncture_ID',DAO_NewsClass::SHIPYARD_CONJUNCTURE_ID);
        View::Assign('News_Index_Conjuncure',$data);

        #获取数据-船厂动态
		$areaCount=8;
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::SHIPYARD_TRENDS_ID.' and M_IsDelete=FALSE and M_IsTop=TRUE order by M_IsTop desc,M_IsTop_Datetime desc,ID desc limit 0,1');
        if($data)
        {
            $data=$data[0];
            $data['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$data['Thumbnail'];
            $data['Content']=strip_tags($data['Content']);
			$areaCount=3;
        }
        View::Assign('News_Index_ShipyardfTrendsTopside',$data);

        $data=DB::GetRows('select * from news where '.($data==NULL ? '1=1':'ID<>'.$data['ID']).' and SubclassID='.DAO_NewsClass::SHIPYARD_TRENDS_ID.' and M_IsDelete=FALSE order by ID desc limit 0,'.$areaCount);
        if($data)
        {
            foreach($data as &$row)
            {
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_ShipyardTrends_ID',DAO_NewsClass::SHIPYARD_TRENDS_ID);
        View::Assign('News_Index_ShipyardTrends',$data);
        
        #获取数据-船厂订单
		$areaCount=7;
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::SHIPYARD_ORDERSHEET_ID.' and M_IsDelete=FALSE and M_IsTop=TRUE order by M_IsTop desc,M_IsTop_Datetime desc,ID desc limit 0,1');
        if($data)
        {
            $data=$data[0];
            $data['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$data['Thumbnail'];
            $data['Content']=strip_tags($data['Content']);
			$areaCount=3;
        }
        View::Assign('News_Index_OrdersheetTopside',$data);
        
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::SHIPYARD_ORDERSHEET_ID.' and M_IsDelete=FALSE order by ID desc limit 0,'.$areaCount);
        if($data)
        {
            foreach($data as &$row)
            {
                $row['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$row['Thumbnail'];
                $row['Content']=strip_tags($row['Content']);
                $row['M_HTMLFile']=Config::PATH_RELATIVE_CONTENT_NEWS.'/'.$row['M_HTMLFile'];
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_Ordersheet_ID',DAO_NewsClass::SHIPYARD_ORDERSHEET_ID);
        View::Assign('News_Index_Ordersheet',$data);

        #获取数据-运行分析
		$areaCount=7;
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::SHIPYARD_ANALYSIS_ID.' and M_IsDelete=FALSE and M_IsTop=TRUE order by M_IsTop desc,M_IsTop_Datetime desc,ID desc limit 0,1');
        if($data)
        {
            $data=$data[0];
            $data['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$data['Thumbnail'];
            $data['Content']=strip_tags($data['Content']);
			$areaCount=3;
        }
        View::Assign('News_Index_AnalysisTopside',$data);
        
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::SHIPYARD_ANALYSIS_ID.' and M_IsDelete=FALSE order by ID desc limit 0,'.$areaCount);
        if($data)
        {
            foreach($data as &$row)
            {
                $row['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$row['Thumbnail'];
                $row['Content']=strip_tags($row['Content']);
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_Analysis_ID',DAO_NewsClass::SHIPYARD_ANALYSIS_ID);
        View::Assign('News_Index_Analysis',$data);

        #获取数据-船配资讯
		$areaCount=8;
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::ANCILLARY_NEWS_ID.' and M_IsDelete=FALSE and M_IsTop=TRUE order by M_IsTop desc,M_IsTop_Datetime desc,ID desc limit 0,1');
        if($data)
        {
            $data=$data[0];
            $data['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$data['Thumbnail'];
            $data['Content']=strip_tags($data['Content']);
			$areaCount=3;
        }
        View::Assign('News_Index_AncillaryNewsTopside',$data);

        $data=DB::GetRows('select * from news where '.($data==NULL ? '1=1':'ID<>'.$data['ID']).' and SubclassID='.DAO_NewsClass::ANCILLARY_NEWS_ID.' and M_IsDelete=FALSE order by ID desc limit 0,'.$areaCount);
        if($data)
        {
            foreach($data as &$row)
            {
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_AncillaryNews_ID',DAO_NewsClass::ANCILLARY_NEWS_ID);
        View::Assign('News_Index_AncillaryNews',$data);


        #获取数据-船配企业动态
		$areaCount=7;
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::ANCILLARY_COMPANY_ID.' and M_IsDelete=FALSE and M_IsTop=TRUE order by M_IsTop desc,M_IsTop_Datetime desc,ID desc limit 0,1');
        if($data)
        {
            $data=$data[0];
            $data['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$data['Thumbnail'];
            $data['Content']=strip_tags($data['Content']);
			$areaCount=3;
        }
        View::Assign('News_Index_AncillaryCompanyTopside',$data);
        
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::ANCILLARY_COMPANY_ID.' and M_IsDelete=FALSE order by ID desc limit 0,'.$areaCount);
        if($data)
        {
            foreach($data as &$row)
            {
                $row['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$row['Thumbnail'];
                $row['Content']=strip_tags($row['Content']);
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_AncillaryCompany_ID',DAO_NewsClass::ANCILLARY_COMPANY_ID);
        View::Assign('News_Index_AncillaryCompany',$data);

        #获取数据-船配订单
		$areaCount=7;
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::ANCILLARY_ORDERSHEET_ID.' and M_IsDelete=FALSE and M_IsTop=TRUE order by M_IsTop desc,M_IsTop_Datetime desc,ID desc limit 0,1');
        if($data)
        {
            $data=$data[0];
            $data['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$data['Thumbnail'];
            $data['Content']=strip_tags($data['Content']);
			$areaCount=3;
        }
        View::Assign('News_Index_AncillaryOrdersheetTopside',$data);
        
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::ANCILLARY_ORDERSHEET_ID.' and ID<>'.$data['ID'].' and M_IsDelete=FALSE order by ID desc limit 0,'.$areaCount);
        if($data)
        {
            foreach($data as &$row)
            {
                $row['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$row['Thumbnail'];
                $row['Content']=strip_tags($row['Content']);
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_AncillaryOrdersheet_ID',DAO_NewsClass::ANCILLARY_ORDERSHEET_ID);
        View::Assign('News_Index_AncillaryOrdersheet',$data);

        #获取数据-钢材行情
		$areaCount=7;
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::ANCILLARY_STEELS_ID.' and M_IsDelete=FALSE and M_IsTop=TRUE order by M_IsTop desc,M_IsTop_Datetime desc,ID desc limit 0,1');
        if($data)
        {
            $data=$data[0];
            $data['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$data['Thumbnail'];
            $data['Content']=strip_tags($data['Content']);
			$areaCount=3;
        }
        View::Assign('News_Index_AncillarySteelsTopside',$data);
        
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::ANCILLARY_STEELS_ID.' and M_IsDelete=FALSE order by ID desc limit 0,'.$areaCount);
        if($data)
        {
            foreach($data as &$row)
            {
                $row['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$row['Thumbnail'];
                $row['Content']=strip_tags($row['Content']);
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_AncillarySteels_ID',DAO_NewsClass::ANCILLARY_STEELS_ID);
        View::Assign('News_Index_AncillarySteels',$data);

        #获取数据-船运市场
		$areaCount=8;
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::SHIPPING_MARKET_ID.' and M_IsDelete=FALSE and M_IsTop=TRUE order by M_IsTop desc,M_IsTop_Datetime desc,ID desc limit 0,1');
        if($data)
        {
            $data=$data[0];
            $data['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$data['Thumbnail'];
            $data['Content']=strip_tags($data['Content']);
			$areaCount=4;
        }
        View::Assign('News_Index_MarketTopside',$data);

        $data=DB::GetRows('select * from news where '.($data==NULL ? '1=1':'ID<>'.$data['ID']).' and SubclassID='.DAO_NewsClass::SHIPPING_MARKET_ID.' and M_IsDelete=FALSE order by ID desc limit 0,'.$areaCount);
        if($data)
        {
            foreach($data as &$row)
            {
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_Market_ID',DAO_NewsClass::SHIPPING_MARKET_ID);
        View::Assign('News_Index_Market',$data);

        #获取数据-船东动态
		$areaCount=8;
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::SHIPPING_TRENDS_ID.' and M_IsDelete=FALSE and M_IsTop=TRUE order by M_IsTop desc,M_IsTop_Datetime desc,ID desc limit 0,1');
        if($data)
        {
            $data=$data[0];
            $data['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$data['Thumbnail'];
            $data['Content']=strip_tags($data['Content']);
			$areaCount=4;
        }
        View::Assign('News_Index_ShiponwerTrendsTopside',$data);

        $data=DB::GetRows('select * from news where '.($data==NULL ? '1=1':'ID<>'.$data['ID']).' and SubclassID='.DAO_NewsClass::SHIPPING_TRENDS_ID.' and M_IsDelete=FALSE order by ID desc limit 0,'.$areaCount);
        if($data)
        {
            foreach($data as &$row)
            {
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_ShiponwerTrends_ID',DAO_NewsClass::SHIPPING_TRENDS_ID);
        View::Assign('News_Index_ShiponwerTrends',$data);

        #获取数据-海工动态
		$areaCount=8;
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::MARITIMEWORKS_TRENDS_ID.' and M_IsDelete=FALSE and M_IsTop=TRUE order by M_IsTop desc,M_IsTop_Datetime desc,ID desc limit 0,1');
        if($data)
        {
            $data=$data[0];
            $data['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$data['Thumbnail'];
            $data['Content']=strip_tags($data['Content']);
			$areaCount=4;
        }
        View::Assign('News_Index_MaritimeworksTopside',$data);

        $data=DB::GetRows('select * from news where '.($data==NULL ? '1=1':'ID<>'.$data['ID']).' and SubclassID='.DAO_NewsClass::MARITIMEWORKS_TRENDS_ID.' and M_IsDelete=FALSE order by ID desc limit 0,'.$areaCount);
        if($data)
        {
            foreach($data as &$row)
            {
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_Maritimeworks_ID',DAO_NewsClass::MARITIMEWORKS_TRENDS_ID);
        View::Assign('News_Index_Maritimeworks',$data);

        #获取数据-海工订单
		$areaCount=8;
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::MARITIMEWORKS_ORDERSHEET_ID.' and M_IsDelete=FALSE and M_IsTop=TRUE and M_IsTop=TRUE order by M_IsTop desc,M_IsTop_Datetime desc,ID desc limit 0,1');
        if($data)
        {
            $data=$data[0];
            $data['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$data['Thumbnail'];
            $data['Content']=strip_tags($data['Content']);
			$areaCount=4;
        }
        View::Assign('News_Index_MaritimeworksOrdersheetTopside',$data);
        
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::MARITIMEWORKS_ORDERSHEET_ID.' and M_IsDelete=FALSE order by ID desc limit 0,'.$areaCount);
        if($data)
        {
            foreach($data as &$row)
            {
                $row['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$row['Thumbnail'];
                $row['Content']=strip_tags($row['Content']);
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_MaritimeworksOrdersheet_ID',DAO_NewsClass::MARITIMEWORKS_ORDERSHEET_ID);
        View::Assign('News_Index_MaritimeworksOrdersheet',$data);

        #获取数据-新造船市场
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::DATA_NEW_ID.' and  M_IsDelete=FALSE order by ID desc limit 0,4');
        if($data)
        {
            foreach($data as &$row)
            {
                $row['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$row['Thumbnail'];
                $row['Content']=strip_tags($row['Content']);
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_DataNew_ID',DAO_NewsClass::DATA_NEW_ID);
        View::Assign('News_Index_DataNew',$data);

        #获取数据-船型
        $data=DB::GetRows('select * from news where ClassID='.DAO_NewsClass::TYPE_ID.' and M_IsDelete=FALSE order by ID desc limit 0,9');
        if($data)
        {
            foreach($data as &$row)
            {
                $row['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$row['Thumbnail'];
                $row['Content']=strip_tags($row['Content']);
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_Type_ID',DAO_NewsClass::TYPE_ID);
        View::Assign('News_Index_Type',$data);

        #获取数据-船配标准
        $data=DB::GetRows('select * from news where ClassID='.DAO_NewsClass::STANDARD_ID.' and M_IsDelete=FALSE order by ID desc limit 0,9');
        if($data)
        {
            foreach($data as &$row)
            {
                $row['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$row['Thumbnail'];
                $row['Content']=strip_tags($row['Content']);
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_Stardand_ID',DAO_NewsClass::STANDARD_ID);
        View::Assign('News_Index_Standard',$data);

        #获取数据-技术
        $data=DB::GetRows('select * from news where ClassID='.DAO_NewsClass::TECHNOLOGY_ID.' and M_IsDelete=FALSE order by ID desc limit 0,10');
        if($data)
        {
            foreach($data as &$row)
            {
                $row['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$row['Thumbnail'];
                $row['Content']=strip_tags($row['Content']);
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_Technology_ID',DAO_NewsClass::TECHNOLOGY_ID);
        View::Assign('News_Index_Technology',$data);

        #获取数据-二手船市场
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::DATA_SECOND_ID.' and M_IsDelete=FALSE order by ID desc limit 0,4');
        if($data)
        {
            foreach($data as &$row)
            {
                $row['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$row['Thumbnail'];
                $row['Content']=strip_tags($row['Content']);
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_DataSecond_ID',DAO_NewsClass::DATA_SECOND_ID);
        View::Assign('News_Index_DataSecond',$data);

        #获取数据-拆船市场
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::DATA_SCRAP_ID.' and M_IsDelete=FALSE order by ID desc limit 0,4');
        if($data)
        {
            foreach($data as &$row)
            {
                $row['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$row['Thumbnail'];
                $row['Content']=strip_tags($row['Content']);
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_DataShipping_ID',DAO_NewsClass::DATA_SCRAP_ID);
        View::Assign('News_Index_DataShipping',$data);

        #获取数据-船运市场
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::DATA_SHIPPING_ID.' and M_IsDelete=FALSE order by ID desc limit 0,4');
        if($data)
        {
            foreach($data as &$row)
            {
                $row['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$row['Thumbnail'];
                $row['Content']=strip_tags($row['Content']);
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_DataScrap_ID',DAO_NewsClass::DATA_SHIPPING_ID);
        View::Assign('News_Index_DataScrap',$data);

        #获取数据-钢材市场
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::DATA_STEELS_ID.' and M_IsDelete=FALSE  order by ID desc limit 0,4');
        if($data)
        {
            foreach($data as &$row)
            {
                $row['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$row['Thumbnail'];
                $row['Content']=strip_tags($row['Content']);
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_DataSteels_ID',DAO_NewsClass::DATA_STEELS_ID);
        View::Assign('News_Index_DataSteels',$data);

        #获取数据-租船市场
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::DATA_RENT_ID.' and M_IsDelete=FALSE  order by ID desc limit 0,4');
        if($data)
        {
            foreach($data as &$row)
            {
                $row['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$row['Thumbnail'];
                $row['Content']=strip_tags($row['Content']);
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_DataRent_ID',DAO_NewsClass::DATA_RENT_ID);
        View::Assign('News_Index_DataRent',$data);

        #获取数据-信贷政策
		$areaCount=8;
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::FINACING_POLICY_ID.' and M_IsDelete=FALSE and M_IsTop=TRUE and M_IsTop=TRUE order by M_IsTop desc,M_IsTop_Datetime desc,ID desc limit 0,1');
        if($data)
        {
            $data=$data[0];
            $data['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$data['Thumbnail'];
            $data['Content']=strip_tags($data['Content']);
			$areaCount=4;
        }
        View::Assign('News_Index_FinacingPolicyTopside',$data);

        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::FINACING_POLICY_ID.' and M_IsDelete=FALSE order by ID desc limit 0,'.$areaCount);
        if($data)
        {
            foreach($data as &$row)
            {
                $row['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$row['Thumbnail'];
                $row['Content']=strip_tags($row['Content']);
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_FinacingPolicy_ID',DAO_NewsClass::FINACING_POLICY_ID);
        View::Assign('News_Index_FinacingPolicy',$data);

        #获取数据-银企合作
		$areaCount=8;
        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::FINACING_COOPERATION_ID.' and M_IsDelete=FALSE and M_IsTop=TRUE and M_IsTop=TRUE order by M_IsTop desc,M_IsTop_Datetime desc,ID desc limit 0,1');
        if($data)
        {
            $data=$data[0];
            $data['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$data['Thumbnail'];
            $data['Content']=strip_tags($data['Content']);
			$areaCount=4;
        }
        View::Assign('News_Index_FinacingCooperationTopside',$data);

        $data=DB::GetRows('select * from news where SubclassID='.DAO_NewsClass::FINACING_COOPERATION_ID.' and M_IsDelete=FALSE order by ID desc limit 0,'.$areaCount);
        if($data)
        {
            foreach($data as &$row)
            {
                $row['Content']=strip_tags($row['Content']);
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_FinacingCooperation_ID',DAO_NewsClass::FINACING_COOPERATION_ID);
        View::Assign('News_Index_FinacingCooperation',$data);

        #获取数据-融资动态
        $data=DAO_News::Area_Subclass(DAO_NewsClass::FINACING_TRENDS_ID,8,4);
        View::Assign('News_Index_FinacingTrendsTopside',$data['Topside']);
        View::Assign('NewsClass_FinacingTrends_ID',DAO_NewsClass::FINACING_TRENDS_ID);
        View::Assign('News_Index_FinacingTrends',$data['Foreach']);


        #获取数据-融资上市
        $data=DAO_News::Area_Subclass(DAO_NewsClass::FINACING_IPO_ID,8,4);
        View::Assign('News_Index_FinacingIPOTopside',$data['Topside']);
        View::Assign('NewsClass_FinacingIPO_ID',DAO_NewsClass::FINACING_IPO_ID);
        View::Assign('News_Index_FinacingIPO',$data['Foreach']);

        #获取数据-政策法规
        $data=DB::GetRows('select * from news where ClassID='.DAO_NewsClass::LAW_ID.' and M_IsDelete=FALSE order by ID desc limit 0,7');
        if($data)
        {
            foreach($data as &$row)
            {
                $row['Thumbnail']=Config::PATH_RELATIVE_ATTACHMENT_NEWS.'/'.$row['Thumbnail'];
                $row['Content']=strip_tags($row['Content']);
                $row['M_HTMLFile']=Config::PATH_RELATIVE_CONTENT_NEWS.'/'.$row['M_HTMLFile'];
                if((time()-strtotime($row['Datetime']))/3600/24<=1)
                    $row['IsNew']='TRUE';
                else
                    $row['IsNew']='FALSE';
            }
        }
        View::Assign('NewsClass_Law_ID',DAO_NewsClass::LAW_ID);
        View::Assign('News_Index_NewsLaw',$data);

        #获取数据-最新期刊
        $data=DB::GetRows('select * from ejournal order by ID desc limit 0,1');
        if($data){
            $data=$data[0];
        }
        View::Assign('News_Index_LatestEjournal',$data);

        #渲染显示
        View::Display('news/index.tpl');
    }
}
?>